#include <iostream>
#include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
#include <cstring>
#include <unistd.h>
using namespace std;

//实现命令行上的kill指令

static void Usage(const string& proc)
{
    cout << "\nUsage: " << proc << " -sigNumber processId" << endl << endl;
}

int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }

    int sigNumber = stoi(argv[1] + 1);
    int processId = stoi(argv[2]);
    kill(processId, sigNumber);
    return 0;
}
